package com.tianpengtech.common.validator.rules.other;

import com.tianpengtech.common.exception.ValidateException;
import com.tianpengtech.common.validator.AbstractRule;

public class MustBeNull extends AbstractRule {

    public MustBeNull(Object obj, String msg) {
        this.value = obj;
        this.msg = msg;
    }


    @Override
    public boolean validate() throws ValidateException {
        if (this.value != null) {
            throw new ValidateException(this.msg);
        }
        return false;
    }
}
